package a.h;

import a.i.b;
import a.i.jb;

import javax.swing.*;
import javax.swing.table.TableCellEditor;
import java.awt.*;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;

class oc
  extends gc
{
  private static TableCellEditor y = new d_();
  static Class z;
  static Class A;
  
  public oc(String paramString, URL paramURL)
  {
    super(paramString, paramURL);
    if (ec.t == 0) {}
    a(z == null ? (oc.z = f("java.net.URL")) : z);
    a(cd.c, y);
  }
  
  public void a(Object paramObject)
  {
    if (ec.t == 0)
    {
      if (((paramObject instanceof URL)) || (paramObject == null)) {
        super.a(paramObject);
      }
    }
    else if (!ec.s) {
      return;
    }
    String str = "Argument type mismatch. Expected java.net.URL but was " + paramObject.getClass().getName();
    throw new IllegalArgumentException(str);
  }
  
  public String n()
  {
    return "URL";
  }
  
  static Class f(String paramString)
  {
    try
    {
      return Class.forName(paramString);
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }
  
  private static class c_
    extends b
  {
    protected c_()
    {
      super();
    }
    
    protected Object a(String paramString)
      throws IllegalArgumentException
    {
      try
      {
        return new URL(paramString);
      }
      catch (MalformedURLException localMalformedURLException) {}
      return null;
    }
    
    protected String a(Object paramObject)
      throws IllegalArgumentException
    {
      return paramObject.toString();
    }
  }
  
  private static class d_
    extends AbstractCellEditor
    implements TableCellEditor, cd.t_
  {
    private JPanel a;
    private JButton b;
    private JTextField c = new JTextField();
    private jb d = new oc.c_();
    private tb f;
    
    public d_()
    {
      this.c.addActionListener(new oc.0(this));
      this.b = new JButton("...");
      this.b.setMargin(new Insets(0, 0, 0, 0));
      this.b.setPreferredSize(new Dimension(this.b.getPreferredSize().width, this.c.getPreferredSize().height));
      this.b.addActionListener(new oc.1(this));
      this.a = new JPanel(new BorderLayout());
      this.a.setOpaque(false);
      this.a.add(this.c, "Center");
      this.a.add(this.b, "East");
    }
    
    String a(String paramString)
    {
      int i = ec.t;
      if (i == 0)
      {
        if (Boolean.TRUE.equals(a().k().c("FileOptionItem.prefixFileProtocol"))) {
          if (i != 0) {
            break label52;
          }
        }
      }
      else if (paramString.startsWith("file://")) {
        paramString = paramString.substring(7);
      }
      label52:
      return paramString;
    }
    
    public tb a()
    {
      return this.f;
    }
    
    public void a(tb paramtb)
    {
      this.f = paramtb;
    }
    
    public Object getCellEditorValue()
    {
      return this.c.getText();
    }
    
    public Component getTableCellEditorComponent(JTable paramJTable, Object paramObject, boolean paramBoolean, int paramInt1, int paramInt2)
    {
      this.c.setText(a(paramObject));
      paramJTable.repaint(paramJTable.getCellRect(paramInt1, paramInt2, false));
      return this.a;
    }
    
    private String a(Object paramObject)
    {
      int i = ec.t;
      if (i == 0) {}
      return this.d.a(paramObject, oc.A == null ? (oc.A = oc.f("java.lang.Object")) : (i != 0) || (paramObject != null) ? paramObject.getClass() : oc.A);
    }
    
    private JFileChooser c()
    {
      int i = ec.t;
      if ((i != 0) || (this.f != null))
      {
        localObject1 = this.f.k();
        Object localObject2 = ((ec)localObject1).c(rc.E);
        if ((i != 0) || ((localObject2 instanceof JFileChooser))) {
          return (JFileChooser)localObject2;
        }
      }
      Object localObject1 = new JFileChooser();
      ((JFileChooser)localObject1).setDialogType(0);
      return localObject1;
    }
    
    private void a(JFileChooser paramJFileChooser)
    {
      String str = this.c.getText();
      str = a(str);
      if (str.length() > 0)
      {
        File localFile = new File(str);
        if ((ec.t != 0) || (!localFile.isDirectory())) {
          localFile = localFile.getParentFile();
        }
        paramJFileChooser.setCurrentDirectory(localFile);
      }
    }
    
    private int c(JFileChooser paramJFileChooser)
    {
      if (ec.t == 0) {
        switch (paramJFileChooser.getDialogType())
        {
        case 0: 
          return paramJFileChooser.showOpenDialog(this.a);
        case 1: 
          return paramJFileChooser.showSaveDialog(this.a);
        case 2: 
          return paramJFileChooser.showDialog(this.a, paramJFileChooser.getApproveButtonText());
        }
      }
      return paramJFileChooser.showOpenDialog(this.a);
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.oc

 * JD-Core Version:    0.7.0.1

 */